﻿using Basic.HrOperateLogModular.Interface;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;
using WeDonekRpc.Helper.Config;

namespace Basic.HrOperateLogModular.Config
{

    [ClassLifetimeAttr(ClassLifetimeType.SingleInstance)]
    internal class OperateLogConfig : IOperateLogConfig
    {
        public OperateLogConfig ( ISysConfig config )
        {
            IConfigSection section = config.GetSection("hr:operateLog");
            section.AddRefreshEvent(this._Init);
        }
        private void _Init ( IConfigSection config, string name )
        {
            this.IsEnable = config.GetValue("IsEnable", true);
            this.Range = config.GetValue("RecordRange", LogRecordRange.全部);

        }
        public bool IsEnable { get; private set; }

        public LogRecordRange Range { get; private set; }
    }
}
